package com.lagou.task10;

public class AnonyMousinterfaceTest {

    public static void test(AnonyMousinterface ai){
        ai.show();
    }
    public static void main(String[] args) {
        AnonyMousinterface af = new AnonymousInterfaceImpl();
        AnonyMousinterfaceTest.test(af);

        System.out.println("----------------------");
        //匿名内部类
        AnonyMousinterface af1 = new AnonyMousinterface() {
            @Override
            public void show() {
                System.out.println("这是一个匿名内部类");
            }
        };
        AnonyMousinterfaceTest.test(af1);
        System.out.println("----------------------");
        //java8开始提出新特性lamda表达式：(参数列表)->{方法体}
        AnonyMousinterface af2 = ()-> System.out.println("lamda 表达式");
        AnonyMousinterfaceTest.test(af2);
    }
}
